package com.gosophia.orgManagement.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseAjaxAction;
import com.gosophia.organizationManagement.dto.OrganizationDTO;
import com.gosophia.organizationManagement.ws.OrganizationManagementWebService;
@Controller("ProveUpdateOrganization")
@Scope("prototype")
public class ProveUpdateOrganization extends BaseAjaxAction<OrganizationDTO> {
    private static final long serialVersionUID = 1L;
    private Long parentId;
    private Long orgId;
    private String orgName;
    private boolean result;
    @Autowired
    private OrganizationManagementWebService organizationManagementWebService;
    @Override
    public OrganizationDTO getDetailData() {
        return this.detailData;
    }

    @Override
    public String _execute() throws Exception {
        Long count = organizationManagementWebService.findEQOrganizationsForUPdateOrgName(orgName, orgId);
        if(count>0){
            result = true;
        }else{
            result = false;
        }
        super.getRequestResult().setRsltCode("0");
        return SUCCESS;
    }

    public static long getSerialversionuid() {
        return serialVersionUID;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public boolean isResult() {
        return result;
    }

    public void setResult(boolean result) {
        this.result = result;
    }

}
